package com.gitee.ywj1352.kaishi.rediss;

import org.redisson.Redisson;
import org.redisson.api.RLock;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;

import java.util.concurrent.TimeUnit;

/**
 * @author wenjie.yang
 * @date 4/22/2020 10:59 AM
 */
public class RedissonDemo {
    final static RedissonClient client;
    static {
        Config config = new Config();
        config.useSingleServer().setAddress("redis://127.0.0.1:6379");
        client = Redisson.create(config);
    }

    public void fun1(){
        RLock lock = client.getLock("lock_01");

        lock.lock(100, TimeUnit.MICROSECONDS);



    }



}
